﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RIO.Utilits
{
    internal static class Extensions
    {
        public static int AvgColor(this System.Drawing.Color color)
        {
            return (color.R + color.G + color.B) / 3;
        }

        public static void Speak(this SpeechLib.SpVoice speaker, string text)
        {
            speaker.Speak(text, SpeechLib.SpeechVoiceSpeakFlags.SVSFDefault);
        }

        public static void ForEach<T>(this IEnumerable<T> collection, Action<T> action)
        {
            foreach (var item in collection)
                action(item);
        }
    }
}
